package com.noreply.springannotation;

import com.noreply.springannotation.config.CatConfig;
import com.noreply.springannotation.config.ConfigAutowired;
import com.noreply.springannotation.service.BookService;
import org.junit.Test;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author noreply
 * @description
 */
public class IOCTestProperty {

    @Test
    public void testAutowired() {
        ApplicationContext applicationContext = new AnnotationConfigApplicationContext(ConfigAutowired.class);
        BookService bookService = applicationContext.getBean(BookService.class);
        bookService.print();
    }
}
